/*
 * Copyright 2020 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import './common';
@import '../Sidecar/mixins';
@import '../../PatternFly/common';

body[kui-theme-style] {
  @include NestedLeftNavWidthConstrained {
    .pf-c-nav {
      max-width: 15em;
    }
  }

  @include Sidecar {
    .pf-c-nav {
      --pf-c-nav__list-toggle--FontSize: 1em;
      width: $nav-width;
      background-color: var(--color-sidecar-header);

      .pf-c-nav__list {
        /** 
         * NOTE: carbon components set section to always display: block
         * in carbon-components/css/carbon-components.css
         * and carbon-components/scss/globals/scss/_css--reset.scss,
         * which overrides browser's default behavior to diplay:none for hidden sections
         */
        section[hidden] {
          display: none;
        }

        a:hover:not(.plain-anchor) {
          color: unset;
        }

        .pf-c-nav__item.pf-m-expandable::before {
          border-bottom-color: var(--pf-global--BackgroundColor--dark-400);
        }

        .pf-c-nav__item .pf-c-nav__list .pf-c-nav__link {
          @include NavItemMaxWidth;
        }

        .pf-c-nav__link:not(.kui--mode-placeholder) {
          padding-left: 1em;
        }

        .pf-c-nav__link {
          color: var(--pf-global--Color);
          &.pf-c-nav__link.pf-m-current {
            background-color: var(--pf-global--BackgroundColor--dark-100);
          }
          &:hover {
            cursor: pointer;
            background-color: var(--pf-global--BackgroundColor--dark-400);
          }
        }

        .pf-c-nav__subnav {
          padding-left: 1em;
        }
      }
    }
  }
}
